package com.aabte.permissionframeworklearn.permission.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author Daniel
 */
@Data
public class AclParam {

    private Long id;

    @NotBlank(message = "权限点名称不能为空！")
    @Length(min = 2, max = 20, message = "权限名称长度需要在2-20个字符内！")
    private String name;

    @NotNull(message = "必须指定权限模块！")
    @Min(value = 1, message = "权限模块不合法！")
    private Long aclModuleId;

    @Length(min = 6, max = 100, message = "权限点URL长度需要在2-100个字符内！")
    private String url;

    @NotNull(message = "必须指定权限点类型！")
    @Min(value = 0, message = "权限点类型不合法！")
    @Max(value = 3, message = "权限点类型不合法！")
    private Integer type;

    @NotNull(message = "必须指定权限点状态！")
    @Min(value = 0, message = "权限点状态不合法！")
    @Max(value = 1, message = "权限点状态不合法！")
    private Integer status;

    @NotNull(message = "必须指定权限点展示顺序！")
    private Integer seq;

    @Length(max = 200, message = "权限点备注长度需要在200个字符内！")
    private String remark;

}
